<?php

class Plyte_Route extends Core_Route {
	
	protected static $_routes = array();

	protected function Plyte_Route($alias, $uri, $callback = false) {
		parent::__construct($uri, $callback);

		if (!$this->_callback)
			$this->_callback = 'Plyte::defaultRouteCallback';

		Route::$_routes[$alias] = $this;
	}

	public static function factory($alias, $uri, $callback = false) {
		return array_key_exists($alias, Route::$_routes) ? Route::$_routes : new Route($alias, $uri, $callback);
	}

	public static function all() {
		return Route::$_routes;
	}

}